<?php

namespace app\common\model\tysj;

/**
 * 店铺推广佣金
 */
class StoreSpreadIncome extends CUBase {
	protected $append = ['type_text', 'store'];

	//返回状态文本信息
    public function getTypeTextAttr() {
        $options = loadEnum('StoreSpreadIncomeType')->get_options();
        try {
            return $options[$this->getData('type')];
        } catch(InvalidArgumentException $e) {
            return null;
        }
    }

    public function getStoreAttr($value, $data) {
    	return loadModel('tysj\\Store')->find($data['sid'])->privacy();
    }
}
